//
//  HJBuyTicketVC.m
//  project
//
//  Created by hu on 2019/4/9.
//  Copyright © 2019 健健. All rights reserved.
//

#import "HJBuyTicketVC.h"
#import "HJBusTicketView.h"
#import "HJTicketOrder.h"
@interface HJBuyTicketVC ()
@property (nonatomic,strong) HJBusTicketView * buybusTicket;
@property (nonatomic,strong) HJTicketOrder * ticketOrderView;
@end

@implementation HJBuyTicketVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navTitle = @"订单详情";
    [self configBtmViewBtn];
}
-(HJTicketOrder *)ticketOrderView {
    if (!_ticketOrderView) {
        _ticketOrderView = [[HJTicketOrder alloc]init];
        _ticketOrderView.frame = CGRectMake(0, CGRectGetMaxY(self.buybusTicket.frame), SCREEN_WIDTH, 195);
    }
    return _ticketOrderView;
}
-(void)configTableView {
    self.tableViewStyle = UITableViewStylePlain;
    [super configTableView];
    self.tableView.tableHeaderView = [self configTableHeader];
    self.tableView.contentInset = UIEdgeInsetsMake(0, 0, Height_TabBar, 0);
}

-(UIView *)configTableHeader {
    UIView * view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 585+195)];
    HJBusTicketView * busTicketView = [[HJBusTicketView alloc]init];
    busTicketView.frame = CGRectMake(0, 0, SCREEN_WIDTH, 585);
    self.buybusTicket = busTicketView;
    [view addSubview:busTicketView];
    
    [view addSubview:self.ticketOrderView];
    return view;
}
-(void)configBtmViewBtn {
    CGFloat btnY = self.view.height - Height_TabBar-34;
    UIButton *releaseButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
    releaseButton.frame = CGRectMake(48, btnY, SCREEN_WIDTH - 96, 68);
    [releaseButton setBackgroundImage:[UIImage imageNamed:@"releasebtn"] forState:(UIControlStateNormal)];
    [releaseButton setTitle:@"立即支付" forState:(UIControlStateNormal)];
    releaseButton.adjustsImageWhenHighlighted = NO;
    releaseButton.titleLabel.font = [UIFont boldSystemFontOfSize:18];
    releaseButton.titleEdgeInsets = UIEdgeInsetsMake(0, 0, 8, 0);
    [releaseButton addTarget:self action:@selector(completButtonClicked) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:releaseButton];
    
}

-(void)completButtonClicked {
    
}
@end
